package com.fastCms.manager.bim.controller.api;


import com.fastCms.business.bim.manage.DataMockManageService;
import com.fastCms.business.bim.pojo.entity.DataMock;
import com.fastCms.business.bim.pojo.po.DataMockListPO;
import com.fastCms.business.frame.response.ApiResponse;
import com.fastCms.manager.frame.annotation.UserAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 区域管理 前端控制器
 * </p>
 *
 * @author liusq
 * @since 2021-04-05
 */
@RestController
@RequestMapping("api/dataMock")
@Api(value = "ApiDataMockController", tags = "前端-手填数据获取")
@UserAccess
public class ApiDataMockController {

    @Autowired
    private DataMockManageService dataMockManageServiceImpl;

    @ApiOperation(value = "列表展示", notes = "")
    @PostMapping("/list")
    public ApiResponse<List<DataMock>> list(@RequestBody DataMockListPO dataMockListPO) {
        ApiResponse<List<DataMock>> result = dataMockManageServiceImpl.list(dataMockListPO);
        return result;
    }

    @ApiOperation(value = "根据编号获取", notes = "")
    @GetMapping("/getByCode/{code}")
    public ApiResponse<DataMock> getByCode(@PathVariable String code) {
        ApiResponse<DataMock> detail = dataMockManageServiceImpl.getByCode(code);
        return detail;
    }


}

